package org.okkam.webservice;

public class ProfileRetrieverProxy implements org.okkam.webservice.ProfileRetriever {
  private String _endpoint = null;
  private org.okkam.webservice.ProfileRetriever profileRetriever = null;
  
  public ProfileRetrieverProxy() {
    _initProfileRetrieverProxy();
  }
  
  public ProfileRetrieverProxy(String endpoint) {
    _endpoint = endpoint;
    _initProfileRetrieverProxy();
  }
  
  private void _initProfileRetrieverProxy() {
    try {
      profileRetriever = (new org.okkam.webservice.ProfileRetrieverServiceLocator()).getProfileRetriever();
      if (profileRetriever != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)profileRetriever)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)profileRetriever)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (profileRetriever != null)
      ((javax.xml.rpc.Stub)profileRetriever)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public org.okkam.webservice.ProfileRetriever getProfileRetriever() {
    if (profileRetriever == null)
      _initProfileRetrieverProxy();
    return profileRetriever;
  }
  
  public java.lang.String getProfileForURI(java.lang.String uri) throws java.rmi.RemoteException{
    if (profileRetriever == null)
      _initProfileRetrieverProxy();
    return profileRetriever.getProfileForURI(uri);
  }
  
  
}